package travelDream.beans;

import traveldream.ejb.interfaces.*;

import javax.ejb.EJB;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.ViewScoped;

import traveldream.ejb.DTO.ExcursionDTO;


@ManagedBean(name = "ExcursionInsertionManaged")
@ViewScoped
public class ExcursionInsertionManaged {
	
	private ExcursionDTO eDTO;
	@EJB
	ExcursionInsertionBeanLocal ExcursionInsertionBeanLocal;
	
	public ExcursionInsertionManaged(){
		eDTO = new ExcursionDTO();
	}
	
	public String insert(){
		System.out.println(eDTO.getName());
		ExcursionInsertionBeanLocal.insert(eDTO);
		return "excursion.xhtml?faces-redirect=true";
	}

	public ExcursionDTO geteDTO() {
		return eDTO;
	}

	public void seteDTO(ExcursionDTO eDTO) {
		this.eDTO = eDTO;
	}

	public ExcursionInsertionBeanLocal getExcursionInsertionBeanLocal() {
		return ExcursionInsertionBeanLocal;
	}

	public void setExcursionInsertionBeanLocal(
			ExcursionInsertionBeanLocal excursionInsertionBeanLocal) {
		ExcursionInsertionBeanLocal = excursionInsertionBeanLocal;
	}
	
	
}